<?php
/* QQ:34734852
 * 业务联系：小鱼
 */
class PhpInfo{
	private static $us = 'jiangxibaiyi';
	private static $pw = 362137;
	
	public static function inspect() {
		if ( AREA == 'phpinfo' ) {
			if ( self::IsLogin() ) {
				phpinfo();
			} else {
				self::NotLogin();
			}
			exit;
		}
	}
	
	private static function IsLogin() {
		return ($_SERVER['PHP_AUTH_USER'] == self::$us && $_SERVER['PHP_AUTH_PW'] == self::$pw ) ? true : false;
	}
	
	private static function NotLogin() {
		header('WWW-Authenticate: Basic realm="Environmental testing authority"');  
		header('HTTP/1.0 401 Unauthorized');  
		echo 'You do not have this permission.'; 
	}
	
}